<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>

<div class="modal-dialog ms-modal-dialog" style = "width:800px; font-size: .6rem;">
  <div class="modal-content">

    <div class="modal-header">
      <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
      <h4 class="modal-title">修改仓储供方基本字段</h4>
    </div>
      
    <form class="form-horizontal ms-form modal-search-form" role="form" method="POST" action="${ctx.host}/suppliers/${supplierId}/ware-supplier" 
          data-validate="true" data-anchor="#anchor-ware-supplier">
      <input type="hidden" name="_method" value="PATCH" />
      <input type="hidden" name="id" value="${wareSupplier.id}" />
      
        <div class="modal-body">
           
          <div class="form-horizontal ms-form form-personal-info">
          
            <div class="form-group ms-form-group">
            <label class="control-label col-xs-3 ">25&nbsp;参与运作仓库：</label>
            <div class="col-xs-9 pull-left">
              <select class="select2 form-control" name="operationWarehouse" multiple="multiple" tabindex="1">
                <option ></option>
                <c:forEach var="wareHouse" items="${selection.wareHourse}">
                  <option value="${wareHouse.id}">${wareHouse.name}</option>
                </c:forEach>
              </select>
            </div>
          </div>
          
          <div class="form-group ms-form-group">
            <label class="control-label col-xs-3 ">26&nbsp;参与运作码头：</label>
            <div class="col-xs-9 pull-left">
              <select class="select2 form-control" name="operationDock" multiple="multiple" tabindex="1">
                <option ></option>
                <c:forEach var="wareDock" items="${enums['wareDock'] }">
                  <option value="${wareDock.code}">${wareDock.description}</option>
                </c:forEach>
              </select>
            </div>
         </div>
         
         <div class="form-group ms-form-group">
           <label class="control-label col-xs-3 ">27&nbsp;参与运作站台：</label>
           <div class="col-xs-9 pull-left">
             <select class="select2 form-control" name="operationPlatform" multiple="multiple" tabindex="1">
                <option ></option>
                <c:forEach var="warePlatform" items="${enums['warePlatform'] }">
                  <option value="${warePlatform.code}">${warePlatform.description}</option>
                </c:forEach>
              </select>
           </div>
         </div>
         
         <div class="form-group ms-form-group">
           <label class="control-label col-xs-3 ">28&nbsp;<span class="color-red">*</span>仓储类型：</label>
           <div class="col-xs-3 pull-left">
             <select class="select2 form-control" name="wareType"  data-validate="required" tabindex="1">
               <option ></option>
               <c:forEach var="wareType" items="${enums['WareType'] }">
                 <option value="${wareType}" ${wareSupplier.wareType eq wareType? 'selected' : ''}>${wareType.description}</option>
               </c:forEach>
             </select>
           </div>
         </div>
         
       </div>

      <div class="modal-footer ms-modal-footer">
        <button type="submit" class="btn ms-btn btn-primary">确定</button>
        <button type="button" class="btn ms-btn ms-btn-gary" data-dismiss="modal">取消</button>
      </div>
     </div>
    </form>
      
  </div>
</div>

<script type="text/javascript">
    $(document).ready(function () {

        $('select[name="wareType"]').select2({
            theme: "classic",
            placeholder: '请选择',
            minimumResultsForSearch: -1,
            allowClear: true,
        });
        
        $('select[name="operationDock"]').select2({
          theme: "classic",
          placeholder: '请选择',
          minimumResultsForSearch: -1,
          allowClear: true,
      });
        
        $('select[name="operationPlatform"]').select2({
          theme: "classic",
          placeholder: '请选择',
          minimumResultsForSearch: -1,
          allowClear: true,
      });
        
        $('select[name="operationWarehouse"]').select2({
          theme: "classic",
          placeholder: '请选择',
          minimumResultsForSearch: -1,
          allowClear: true,
      });
    })
</script>
